package Solutions

import "sort"

func minSubsequence(nums []int) []int {
    var sum=0
    for _,v:=range nums{
        sum+=v
    }
    preSum:=0
    sort.Ints(nums)
    for i:=len(nums)-1;i>=0;i--{
        preSum+=nums[i]
        if preSum>sum-preSum{
            ans:=make([]int,len(nums)-i)
            for j:=0;j<len(ans);j++{
                ans[j]=nums[len(nums)-j-1]
            }
            return ans
        }
    }
    return []int{}
}